<template>
  <div class="consultpart">
    <van-sticky :offset-top="46">
      <serchCommon></serchCommon>
    </van-sticky>
    <swiperDom :banners="bannerList"></swiperDom>
    <partmorennews></partmorennews>
  </div>
</template>
<script type="text/ecmascript-6">
import partmorennews from "../../components/newslist/loadReportList";
import serchCommon from "../../components/menuSearch/serchconsult";
import { getbanner } from "../../api/sort";
import swiperDom from "../../components/siwperDom";
export default {
  components: {
    partmorennews,
    serchCommon,
    swiperDom
  },
  data() {
    return {
      bannerList: []
    };
  },
  beforeRouteEnter(to, from, next) {
    if (from.path === "/newsDetails" || from.path == "/search") {
      to.meta.isBack = true;
    } else {
      to.meta.isBack = false;
    }
    next();
  },
  methods: {
    getbanners() {
      let obj = {};
      obj.place = this.$route.query.channel;
      getbanner(obj).then(res => {
        if (res.code == "0000") {
          this.bannerList = res.data;
        }
      });
    }
  },
  created() {
    this.getbanners();
  }
};
</script>
<style scoped lang="less">
</style>
